import type { AddressItem } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'

// 定义 Store
export const useAddressStore = defineStore('userAddress', () => {
    const selectedAddress = ref<AddressItem>()

    const changeSelectedAddress = (item: AddressItem) => {
        selectedAddress.value = item
    }

    return {
        selectedAddress,
        changeSelectedAddress,
    }
})